<?php
include_once '../library/config.php';
include_once '../model/stafflist.php';
include_once '../model/userlist.php';
include_once '../model/stafflistview.php';
StaffList::IsLogin();
$list = new UserList();
$staff = new StaffList();
$stafflistview = new StaffListView();
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <link href="/css/reset.css" rel="stylesheet" type="text/css" />
        <link href="/css/layout.css" rel="stylesheet" type="text/css" />
        <title>后台管理系统</title>
    </head>
    <body>
        <form method="post" id="mainwrap">
            <div class="toolbar">
                <button type="button" transadapter="append" select="false">增加</button>
                <button type="button" transadapter="editxinxi">修改</button>
                <button type="button" transadapter="delete">删除</button>
                <input type="hidden" id="transadapter" find="[name='id']:checked" />
            </div>
            <div class="mainwrapassist">
                <table class="wp100 tc cellbor">
                    <thead>
                        <tr>
                            <th>选择</th>
                            <th>姓名</th>
                            <th>性别</th>
                            <th>年龄</th>
                            <th>账号</th>
                            <th>地址</th>
                            <th>电话</th>
                            <th>时间</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $list->pagesize = 10;
                        $list->select()->where('state = 1')->get_page_desc("myid");
                        while ($list->for_in_rows()) {
                            $sex = [1 => '男', 2 => '女'];
                            $time = date('Y-m-d H:i:s', $list['time'])
                            ?>
                            <tr>
                                <td><input type="radio" name="id" value="<?php echo $list["myid"]; ?>" /></td>
                                <td><?php echo $list['realname']; ?></td>
                                <td><?php echo @$sex[$list['sex']]; ?></td>
                                <td><?php echo $list['age']; ?></td>
                                <td><?php echo $list['account']; ?></td>
                                <td>地址</td>
                                <td><?php echo $list['telphone']; ?></td>
                                <td><?php echo $time; ?></td>
                            </tr>
                            <?php
                        }
                        ?>
                    </tbody>
                </table>
            </div>
            <div class="statusbar">
                <?php
                $pag = new Pagination($list);
                $pag->pageinfo()->firstpage()->loop_page()->lastpage()->display();
                ?>
            </div>
        </form>
        <?php include_once '../inc/js.html'; ?>
        <script src="controller.js"></script>
    </body>
</html>


